/*
 * @Author       : Bing Chen chenbing@iocharger.com
 * @Date         : 2024-12-13 23:57:18
 * @LastEditors  : Bing Chen chenbing@iocharger.com
 * @LastEditTime : 2025-03-15 13:00:36
 * @FilePath     : \openchaoji-corelib\shared\src\OpenChaoJi_const_name.c
 * @Description  :
 *
 * Copyright (c) 2025 OpenChaoJi
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the icense for the specific language governing permissions and
 * limitations under the License.
 *
 */
#include "OpenChaoJi_shared.h"

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B == CONFIG_YES)

const char * enum_names_OpenChaoJi_pilot_status_gbt18487_b(int val)
{
    const char * c_names_OpenChaoJi_pilot_status_gbt18487_b[OPENCHAOJI_PILOT_STATUS_GBT18487_B_NUM] =
    {
        "PILOT_B_A",
        "PILOT_B_Ap",
        "PILOT_B_B",
        "PILOT_B_C",
        "PILOT_B_D",
        "PILOT_B_E",
        "PILOT_B_UNKNOWN",
    };

    if (val >= 0 && val < OPENCHAOJI_PILOT_STATUS_GBT18487_B_NUM)
    {
        return c_names_OpenChaoJi_pilot_status_gbt18487_b[val];
    }
    else
    {
        return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_CANType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_CAN_TYPE_20: return "CAN2.0";
    case OPENCHAOJI_GBT27930_B_CAN_TYPE_FD: return "CAN FD";
    case OPENCHAOJI_GBT27930_B_CAN_TYPE_XL: return "CAN XL";
    default: return "Unknown";
    }

}

const char * enum_names_OpenChaoJi_gbt27930_b_VersionResultType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_VERSION_RESULT_TYPE_CONTINUE: return "Ver_Continue";
    case OPENCHAOJI_GBT27930_B_VERSION_RESULT_TYPE_SUCCEED: return "Ver_Succeed";
    case OPENCHAOJI_GBT27930_B_VERSION_RESULT_TYPE_FAILED: return "Ver_Failed";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_FCType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_FC_TYPE_FUNC_NEGO : return "FuncNego";
    case OPENCHAOJI_GBT27930_B_FC_TYPE_PARAM_CONFIG: return "ParamConfig";
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_AUTH == CONFIG_YES)
    case OPENCHAOJI_GBT27930_B_FC_TYPE_AUTH: return "Auth";
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_RESERVE == CONFIG_YES)
    case OPENCHAOJI_GBT27930_B_FC_TYPE_RESERVE: return "Reserve";
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SELFCHECK == CONFIG_YES)
    case OPENCHAOJI_GBT27930_B_FC_TYPE_SELFCHECK: return "SelfCheck";
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SUPPLY == CONFIG_YES)
    case OPENCHAOJI_GBT27930_B_FC_TYPE_SUPPLY: return "Supply";
#endif
    case OPENCHAOJI_GBT27930_B_FC_TYPE_ENERGY: return "Charging/Discharging";
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_STATISTICS == CONFIG_YES)
    case OPENCHAOJI_GBT27930_B_FC_TYPE_STATISTICS: return "Statistics";
#endif
#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_B_FUNC_SERVICE_IDLE == CONFIG_YES)
    case OPENCHAOJI_GBT27930_B_FC_TYPE_SERVICE_IDLE: return "ServiceIdle";
#endif
    case OPENCHAOJI_GBT27930_B_FC_TYPE_SERVICE_STOPPING: return "ServiceStopping";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_CheckType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_CHECK_TYPE_NOT_CHECK: return "Not_Check";
    case OPENCHAOJI_GBT27930_B_CHECK_TYPE_CHECKING: return "Checking";
    case OPENCHAOJI_GBT27930_B_CHECK_TYPE_CHECK_FINISHED: return "Check_Finished";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_CheckResult(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_CHECK_RESULT_FAILED: return "Result_Failed";
    case OPENCHAOJI_GBT27930_B_CHECK_RESULT_SUCCEED: return "Result_Succeed";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_LatchingStatusType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_LATCHING_STATUS_TYPE_NOT_LOCK: return "Unlock";
    case OPENCHAOJI_GBT27930_B_LATCHING_STATUS_TYPE_LOCKED: return "Locked";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_ReadyType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_READY_TYPE_NOT_READY: return "Not_Ready";
    case OPENCHAOJI_GBT27930_B_READY_TYPE_READY: return "Ready";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_ChargeModeType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_CHARGE_MODE_TYPE_CURRENT: return "Const_Current";
    case OPENCHAOJI_GBT27930_B_CHARGE_MODE_TYPE_VOLTAGE: return "Const_Voltage";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_PowerSupplyEndType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_POWER_SUPPLY_END_TYPE_END: return "End";
    case OPENCHAOJI_GBT27930_B_POWER_SUPPLY_END_TYPE_INVALID: return "Invalid";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_ReasonType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_REASON_TYPE_GRID: return "Grid";
    case OPENCHAOJI_GBT27930_B_REASON_TYPE_CHARGER: return "Charger";
    case OPENCHAOJI_GBT27930_B_REASON_TYPE_OTHER: return "Other";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_PhaseACKType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_PHASE_ACK_FAILED: return "ACK_Failed";
    case OPENCHAOJI_GBT27930_B_PHASE_ACK_SUCCEED: return "ACK_Succeed";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_ContactStatusType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_CONTACT_STATUS_OPENED: return "Opened";
    case OPENCHAOJI_GBT27930_B_CONTACT_STATUS_CLOSED: return "Closed";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_CAuthenStatusType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_SECC_AUTH_STATUS_START_CONTINUE: return "Auth_Continue";
    case OPENCHAOJI_GBT27930_B_SECC_AUTH_STATUS_FINISHED: return "Auth_Finished";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_VAuthenStatusType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_EVCC_AUTH_STATUS_WAIT_REJECTED: return "Auth_Rejected";
    case OPENCHAOJI_GBT27930_B_EVCC_AUTH_STATUS_WAIT_CONTINUE: return "Auth_Continue";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_AuthenResultType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_AUTH_RESULT_FAILED: return "Auth_Failed";
    case OPENCHAOJI_GBT27930_B_AUTH_RESULT_SUCCEED: return "Auth_Succeed";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_ScheACKType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_SCHE_ACK_FAILED: return "ScheACK_Failed";
    case OPENCHAOJI_GBT27930_B_SCHE_ACK_SUCCEED: return "ScheACK_Succeed";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_ScheNegoType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_SCHE_NEGO_FAILED: return "ScheNego_Failed";
    case OPENCHAOJI_GBT27930_B_SCHE_NEGO_SUCCEED: return "ScheNego_Succeed";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_SupportChargeType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_SUPPORT_CHARGE_TYPE_NO: return "Support_No";
    case OPENCHAOJI_GBT27930_B_SUPPORT_CHARGE_TYPE_YES: return "Support_Yes";
    case OPENCHAOJI_GBT27930_B_SUPPORT_CHARGE_TYPE_CONFIRM: return "Support_Confirm";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_PauseStatusType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_PAUSE_STATUS_PAUSE: return "Pause";
    case OPENCHAOJI_GBT27930_B_PAUSE_STATUS_CHARGE: return "Charge";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_b_AdaptorType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_B_ADAPTOR_A: return "Adaptor_A";
    case OPENCHAOJI_GBT27930_B_ADAPTOR_B: return "Adaptor_B";
    default: return "Unknown";
    }
}
#endif

#if (OPENCHAOJI_CONFIG_ENABLE_GBT27930_A == CONFIG_YES)
/********************************** A类系统  **********************************/

const char * enum_names_OpenChaoJi_pilot_status_gbt18487_a(int val)
{
    const char * c_names_OpenChaoJi_pilot_status_gbt18487_a[OPENCHAOJI_PILOT_STATUS_GBT18487_A_NUM] =
    {
        "PILOT_A_DISCONNECT",
        "PILOT_A_CONNECTED",
        "PILOT_A_S1_OPEN",
        "PILOT_A_UNKNOWN",
    };

    if (val >= 0 && val < OPENCHAOJI_PILOT_STATUS_GBT18487_A_NUM)
    {
        return c_names_OpenChaoJi_pilot_status_gbt18487_a[val];
    }
    else
    {
        return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_ChargeModeType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_CHARGE_MODE_TYPE_CURRENT: return "Const_Current";
    case OPENCHAOJI_GBT27930_A_CHARGE_MODE_TYPE_VOLTAGE: return "Const_Voltage";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_PauseStatusType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_PAUSE_STATUS_PAUSE: return "Pause";
    case OPENCHAOJI_GBT27930_A_PAUSE_STATUS_CHARGE: return "Charge";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_RecognizeType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_RECOGNIZE_TYPE_NOT_RECOGNIZED: return "Not_Recognized";
    case OPENCHAOJI_GBT27930_A_RECOGNIZE_TYPE_RECOGNIZED: return "Recognized";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_ReadyType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_READY_TYPE_NOT_READY: return "Not_Ready";
    case OPENCHAOJI_GBT27930_A_READY_TYPE_READY: return "Ready";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_BattType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_BATT_TYPE_LA: return "LA";
    case OPENCHAOJI_GBT27930_A_BATT_TYPE_NIMH: return "Ni-MH";
    case OPENCHAOJI_GBT27930_A_BATT_TYPE_LFP: return "LFP";
    case OPENCHAOJI_GBT27930_A_BATT_TYPE_LMO: return "LMO";
    case OPENCHAOJI_GBT27930_A_BATT_TYPE_LCO: return "LCO";
    case OPENCHAOJI_GBT27930_A_BATT_TYPE_NCM: return "NCM";
    case OPENCHAOJI_GBT27930_A_BATT_TYPE_PLB: return "PLB";
    case OPENCHAOJI_GBT27930_A_BATT_TYPE_LTO: return "LTO";
    case OPENCHAOJI_GBT27930_A_BATT_TYPE_OTHER: return "Other";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_BattPropertyType(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_BATT_PROPERTY_TYPE_RENTED: return "Rented";
    case OPENCHAOJI_GBT27930_A_BATT_PROPERTY_TYPE_PRIVATE: return "Private";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_StopCodeState(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_STOPCODE_STATE_NORMAL: return "0";
    case OPENCHAOJI_GBT27930_A_STOPCODE_STATE_SET: return "1";
    case OPENCHAOJI_GBT27930_A_STOPCODE_STATE_UNTRUSTED: return "UnTrusted";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_FaultState(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_FAULT_STATE_NORMAL: return "0";
    case OPENCHAOJI_GBT27930_A_FAULT_STATE_FAULT: return "1";
    case OPENCHAOJI_GBT27930_A_FAULT_STATE_UNTRUSTED: return "UnTrusted";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_FaultState_CellVolt(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_FAULT_STATE_CELLVOLT_NORMAL: return "0";
    case OPENCHAOJI_GBT27930_A_FAULT_STATE_CELLVOLT_HIGH: return "High";
    case OPENCHAOJI_GBT27930_A_FAULT_STATE_CELLVOLT_LOW: return "Low";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_FaultState_SOC(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_FAULT_STATE_SOC_NORMAL: return "0";
    case OPENCHAOJI_GBT27930_A_FAULT_STATE_SOC_HIGH: return "High";
    case OPENCHAOJI_GBT27930_A_FAULT_STATE_SOC_LOW: return "Low";
    default: return "Unknown";
    }
}

const char * enum_names_OpenChaoJi_gbt27930_a_ErrorState(int val)
{
    switch(val)
    {
    case OPENCHAOJI_GBT27930_A_ERROR_STATE_NORMAL: return "0";
    case OPENCHAOJI_GBT27930_A_ERROR_STATE_TIMEOUT: return "1";
    case OPENCHAOJI_GBT27930_A_ERROR_STATE_UNTRUSTED: return "UnTrusted";
    default: return "Unknown";
    }
}
#endif
